Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subcommunities: add invitation request #1067

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

carlinmack
Copy link
Contributor

@carlinmack carlinmack commented Nov 18, 2024

Close #1061

image

Tests failing because of import errors

site/zenodo_rdm/legacy/requests/utils.py Outdated Show resolved Hide resolved
site/zenodo_rdm/legacy/requests/utils.py Outdated Show resolved Hide resolved
site/zenodo_rdm/subcommunities/request.py Outdated Show resolved Hide resolved
Comment on lines 154 to 156
return current_community_records_service.search(
system_identity, community_id=community_id
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

major/shelve: this method only returns the first 25 results from the record search, so the code below doesn't "bulk add" all the records of the community.

This actually is a bug even in our subcommunity inclusion request logic above, which means that when we accept subcommunity requests, this doesn't add ALL the records of the community to the parent community.

It's relatively low impact though, since most communities don't have that many records (or probably have no records at all, since they've just being created). For the new request type though, this will not be the case, so this has to be fixed relatively quick.

Comment on lines +180 to +181
NAME = "TODO"
ACRONYMS = "TODO"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor/shelve: these will probably be part of the data/payload of the request, so we can easily pass them as parameters when bulk creating the requests.

site/zenodo_rdm/subcommunities/request.py Outdated Show resolved Hide resolved
site/zenodo_rdm/subcommunities/request.py Outdated Show resolved Hide resolved
move submit_join_as_subcommunity_request to communities services
"cancel": actions.CancelAction,
# Custom implemented actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean by "custom implemented actions"? custom = only present in zenodo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom meaning that they aren't using the default actions.Action. Comment was added to match invenio-communities
https://github.com/inveniosoftware/invenio-communities/blob/master/invenio_communities/subcommunities/services/request.py#L70

expires_at = self.request.expires_at.strftime("%B %d, %Y")
NAME = "TODO"
ACRONYMS = "TODO"
self.request["description"] = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be in a template?

child = self.request.receiver.resolve().id
parent = self.request.created_by.resolve().id

_add_community_records(child, parent, uow)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it mean you add records to parent community when invitation expires? Since I don't know the requirements it seems a bit counter intuitive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, by default they will be included if the request expires. The thinking is that this is mutually beneficial and the request would only be declined if there has been a mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create subcommunity invitation request
3 participants